<?php

if (!defined('INCLUDED_AMEMBER_CONFIG')) 
	die("Direct access to this location is not allowed");
	
class protect_wp extends amember_integration_plugin
{
    function update_wordpress($member_id){
        if($_SESSION[_amember_id] && $_SESSION[_amember_id] == $member_id){
            $_SESSION[_amember_reload_user_data]++;
        }

    }
    function subscription_added($member_id){
        $this->update_wordpress($member_id);
    }
    function subscription_updated($member_id){
        $this->update_wordpress($member_id);
    }
    function subscription_deleted($member_id){
        $this->update_wordpress($member_id);
    }
    function subscription_removed($member_id){
        $this->update_wordpress($member_id);
    }
}
global $protect_wp;
global $plugin_error;
$protect_wp = instantiate_plugin("protect", "wp");
$protect_wp->init();
?>